doctype html
html(lang='en')
  head
    title='Segment Annotation Viewer'
    meta(charset='UTF-8')
    link(rel='stylesheet', href='//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css')
    link(rel='stylesheet', href='//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css')
    link(rel='stylesheet', href=`${baseUrl}/client/js/vendor/jquery-ui/css/opentip.css`)
    link(rel='stylesheet', href=`${baseUrl}/css/part-annotator.css`)
  body
    #main
      #canvas
        #mouseToolTip.mouse-tooltip
      #namesPanel.overlay.btn-group.btn-group-vertical
        span#namesPanelButton Labels
        #namesPanelInner
          #nameButtonsDiv.btn-group.btn-group-vertical
      #instructionsPanel.overlay.btn.btn-default.btn-lg.glyphicon.glyphicon-question-sign
        p#instructions
      #counterBox.btn-group.overlay
    //- We pack globals with any render-specific information
    //- that we would like the App to be able to access.
    //- annotationId: !{annotationId === undefined ? undefined : annotationId},
    script
      | window.globals = {
      |   modelId: "#{modelId}",
      |   workerId: "#{workerId}",
      |   sessionId: "#{sessionId}",
      if annotationId !== undefined
        | annotationId: #{annotationId},
      |   base_url: "#{baseUrl}"
      | };

    // Load require.js and start the app
    script(src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js")
    script(src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js")
    script(src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js")
    script(src="//cdnjs.cloudflare.com/ajax/libs/bootbox.js/4.4.0/bootbox.min.js")
    script(src=`${baseUrl}/three.min.js`)
    script(src=`${baseUrl}/scanNet.bundle.js`)
    script.
      $('#namesPanelButton').click(function () {
        $('#namesPanelInner').toggle();
      });
      var annotator = new STK.SegmentAnnotationViewer({
        container: document.getElementById('canvas'),
        delayedLoading: true
      });
      annotator.start();
      annotator.assetManager.registerCustomAssetGroups({
      assetFiles: STK.Constants.scanAssetsFile,
      filterByAssetId: annotator.getAnnotationItemId(),
        callback: function(err, res) {
          annotator.setupScene();
      }
      });
      window.app = annotator;  // For console debugging!
